/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



package com.wp1.servlets;

//~--- non-JDK imports --------------------------------------------------------

import com.wp1.servlets.thread.SpawnCrawler;
import org.directwebremoting.ServerContext;
import org.directwebremoting.ServerContextFactory;

//~--- JDK imports ------------------------------------------------------------

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class BroadcastServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Service       service = new Service();
        ServerContext wctx    = ServerContextFactory.get(this.getServletContext());
        Wp1ApiFactory.create(service, wctx);

        System.out.println(System.getProperty("user.dir"));


        new SpawnCrawler().start();
        

        PrintWriter writer = response.getWriter();

        writer.println("Done");
        writer.close();
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
